#ifndef XPM_CONTROL_XPM_DOC_Translator_H
#define XPM_CONTROL_XPM_DOC_Translator_H

#include <vector>
#include <algorithm>
#include <string>
#include "model/XpmTermDoc.h"
#include "control/TermFactory.h"



namespace xpm {
	using namespace std;	
	class XpmDocTranslator {
	public:
		XpmDocTranslator(conex::TermFactory* termFactory): _termFactory(termFactory), _termControl(0) {}
		void translate(const wstring& syntax, const XpmTermDoc& doc, wstring& _syntax, XpmTermDoc& _doc);
		void translateAll(const wstring& syntax, const XpmTermDoc& doc, wstring& _syntax, XpmTermDoc& _doc);
		void translateNames(const wstring syntax, const XpmTermDoc doc, wstring& _syntax, XpmTermDoc& _doc);
		//get current termcontrol
		string otherLang(const string& lang);
	private:
		conex::TermControl* _termControl;
		conex::TermFactory* _termFactory;
	};
	inline void XpmDocTranslator::translate(const wstring& syntax, const XpmTermDoc& doc, wstring& _syntax, XpmTermDoc& _doc) {
		translateAll(syntax, doc, _syntax, _doc);
	}
	inline string XpmDocTranslator::otherLang(const string& lang) {
		if(lang == "en")
			return "chs";
		else
			return "en";
	}
}
#endif